//
// Created on 24/10/12.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#include "XComponentUtils.h"


std::optional<std::string> XComponentUtils::getId(OH_NativeXComponent *comp) {
    char id[OH_XCOMPONENT_ID_LEN_MAX + 1] = { '\0' };
    uint64_t idSize = OH_XCOMPONENT_ID_LEN_MAX + 1;
    XCOMP_RETURN_IF_NOT_OK(std::nullopt, GetXComponentId(comp, id, &idSize));
    return id;
}
